﻿namespace OpenLS.Spreadsheet.UI
{
    class AlignmentFormatter: FormatterBase
    {
        private VerticalCellAlignment? _verticalAlignment;
        private HorizontalCellAlignment? _horizontalAlignment;
        private double _indentation;

        protected override void ApplyOverride(Range selection)
        {
            if (VerticalAlignment != null)
                selection.SetCellValue(CellProperty.VerticalAlignment, this.VerticalAlignment.Value);
            if (HorizontalAlignment != null)
                selection.SetCellValue(CellProperty.HorizontalAlignment, this.HorizontalAlignment.Value);
        }
        public double Indentation
        {
            get
            {
                return _indentation;
            }
            set { _indentation = value; SetDirty(); }
        }

        public VerticalCellAlignment? VerticalAlignment
        {
            get { return _verticalAlignment; }
            set { _verticalAlignment = value;SetDirty(); }
        }

        public HorizontalCellAlignment? HorizontalAlignment
        {
            get { return _horizontalAlignment; }
            set { _horizontalAlignment = value; SetDirty(); }
        }
    }
}